In many computer-type applications, a plurality of items that are to be displayed to a user in a defined area on a display or the like are organized according to a table layout. As may be appreciated, the defined area maybe a ‘window’ within the display devoted to some defined functional commonality. For example, if the defined area represents options for settings in connection with a computer application, the items may relate to displaying and setting such options. Likewise, if the defined area represents a shut-down interface in connection with a computer application, the items may relate to available choices for proceeding with a shut-down of such application. Thus, each item in such defined area likely has some relationship to the functional commonality, and such item may for example be a text entry box, a text display box, a selection button, a check mark line, a tab, a drop-down line, or the like.
Typically, a table layout for a defined area includes a plurality of defined cells arranged in defined rows and columns, and each item to be set forth within the table layout is specified according to defined attributes including row and column placement and extent, and may have a defined row height and/or column width, perhaps expressed in pixels or other display units. Thus, each item is positioned within the table layout with the other items based on the attributes thereof, and in doing so the table layout is adjusted as necessary and/or desirable, at least within a defined framework.
That is, the table layout itself is specified according to defined attributes, including a number of rows, a number of columns, a row height, a column width, a column width for at least some columns, a row height for at least some rows, and the like. Note, though, that in the course of placing items within a table layout, at least some of the table layout attributes are modified so that the table layout can accommodate the items. For example, if an item is to be placed in a cell at a particular row and column of the table, and the item has a row height of 20 pixels and a column width of 100 pixels, the cell receiving such item should be modified as necessary to have a column width of at least 100 pixels and a row height of at least 20 pixels, and the table layout should be adjusted accordingly, presuming of course that other table layout attributes do not dictate otherwise.
Note that in at least some instances, each item is a ‘control’ and the table layout is itself a ‘control’ containing the controls representing the items. As may be appreciated, using controls allows a designer to design the table layout and the items therein by selecting pre-defined stock controls from an available toolbox containing same and then by modifying each selected control as necessary to result in a final form. Typically, each control includes functionality both to aid the designer in designing with same and to aid the user in using same, of course along with base functionality that allows the control to operate in the manner required.
In many computer-type applications, table layouts are dynamic in that such table layouts can change based on several factors. For example, a table layout may change based on a user re-sizing same, based on an item being added thereto or removed therefrom, based on content displayed in connection with an item changing, based on a size of an item changing, etc. Significantly, each time a dynamic table layout changes, space allocation therewithin must be performed anew.
Thus, heuristics have been developed to allocate space within a table layout in a relatively time-efficient manner. However, situations arise wherein space allocation in a table layout is problematic. In one instance in particular, in a table layout where items are allowed to span multiple rows and/or columns, determining the size of the rows and columns based on the aforementioned heuristics becomes challenging. Ideally, and for purposes of both efficient space utilization and aesthetics, there should be a minimum of extra space in any row/column, and space should get distributed evenly among rows/columns, if at all possible. However, under certain circumstances, the aforementioned heuristics are lacking in achieving such goals.
Accordingly, a need exists for a heuristic that is better suited to allocating space within a table layout. In particular, a need exists for such a heuristic that is not complex and therefore can be performed in real-time or near-real-time in response to changes to a dynamic table layout. Finally, a need exists for a heuristic that finds or at least approximates an ideal distribution of items within a table layout in most cases, without solving systems of equations.